import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const spotsInfoStore = defineStore('spotsInfo', () => {
    let cityData = ref([])//存放当前城市的景点数据
    let tempData = ref([])//临时存放当前城市的景点数据
    let FoodData = ref([])//美食数据
    let HouseData = ref([])//住宿数据
    let spot = ref(new Map())
    let cityname = ref('')
    let selectedSpot = ref(null)
    let EditOpen = ref(false)
    let AddOpen = ref(false)
    //美食推荐模块
    let FoodOpen = ref(false)//打开食物展示界面
    let selectFood = ref(null)
    let FuncFoodOn = ref(false)//打开距离控制界面
    let Radius = ref(null)
    let TableFood = ref(null)
    //住房推荐模块
    let selectHouse = ref(null)
    let HouseRadius = ref(null)
    let HouseOpen = ref(false)
    let FuncHouseOn = ref(false)
    let TableHouse = ref(null)
    //ai模块
    let aiOpen = ref(false)
    let aimessage = ref(null)
    function Setcityname(value) {
        cityname.value = value
    }
    function Setspot(value) {
        spot.value.clear()
        spot.value = value
    }
    function SetcityData(value) {
        cityData.value = value
    }
    function SetSelectedSpot(value) {
        selectedSpot.value = value
    }
    function SettempData(value) {
        tempData.value = value
    }
    function SetEditOpen(value) {
        EditOpen.value = value
    }
    function SetAddOpen(value) {
        AddOpen.value = value
    }
    function SetFoodData(value) {
        FoodData.value = value
    }
    function SetHouseData(value) {
        HouseData.value = value
    }
    function SetFoodOpen(value) {
        FoodOpen.value = value
    }
    function SetSelectedFood(value) {
        selectFood.value = value
    }
    function SetFuncFoodOn(value) {
        FuncFoodOn.value = value
    }
    function SetRadius(value) {
        Radius.value = value
    }
    function SetSelectedHouse(value) {
        selectHouse.value = value
    }
    function SetHouseRadius(value) {
        HouseRadius.value = value
    }
    function SetHouseOpen(value) {
        HouseOpen.value = value
    }
    function SetFuncHouseOn(value) {
        FuncHouseOn.value = value
    }
    function SetTableFood(value) {
        TableFood.value = value
    }
    function SetTableHouse(value) {
        TableHouse.value = value
    }
    function SetAiOpen(value) {
        aiOpen.value = value
    }
    function SetAiMessage(value) {
        aimessage.value = value
    }
    return {
        spot, Setspot,
        cityname, Setcityname,
        cityData, SetcityData,
        selectedSpot, SetSelectedSpot,
        tempData, SettempData,
        EditOpen, SetEditOpen,
        AddOpen, SetAddOpen,
        FoodData, SetFoodData,
        HouseData, SetHouseData,
        FoodOpen, SetFoodOpen,
        selectFood, SetSelectedFood,
        FuncFoodOn, SetFuncFoodOn,
        Radius, SetRadius,
        selectHouse, SetSelectedHouse,
        HouseRadius, SetHouseRadius,
        HouseOpen, SetHouseOpen,
        FuncHouseOn, SetFuncHouseOn,
        TableFood, SetTableFood,
        TableHouse, SetTableHouse,
        aiOpen, SetAiOpen,
        aimessage, SetAiMessage,
    }
})
